/**
* @file RstDecoder.h in InsCubeDecoder
* @author rebeater
* @comment
* Create on 3/14/22 8:53 PM
* @version 1.0
**/

#ifndef INSCUBEDECODER__RSTHANDLE_H_
#define INSCUBEDECODER__RSTHANDLE_H_
#include "HandleBase.h"
#include "RawStruct.h"
#include "NavStruct.h"
namespace InsCube {
/*
#define CRC32_POLY 0x04C11DB7U
#define CRC32_START 0xFFFFFFFFU
#ifndef HARDWARE_CRC
#define HARDWARE_CRC  0
#endif
uint32_t crc_checksum(const uint8_t *indata, int num_bytes) {
#if HARDWARE_CRC == 1
  return 0xfff;
  *//*在STM32中通过硬件硬件实现 *//*
#else
  *//*软件校验*//*
  uint32_t crc = CRC32_START;
  const uint8_t *p = indata;
  for (int i = 0; i < num_bytes; i++) {
    crc = crc ^ (*p++ << 24U);
    for (int bit = 0; bit < 8; bit++) {
      if (crc & (1LU << 31U)) crc = (crc << 1U) ^ CRC32_POLY;
      else crc = (crc << 1U);
    }
  }
#endif
  return crc;
}*/

class RstHandle : public HandleBase {
 public:
  explicit RstHandle();
  const int frame_length = 48 + 18;
  bool ParserNav(uint8_t *data, NavOutput &output) const;
  uint32_t CrcCheckSum(const uint8_t *indata, int num_bytes) const;
 public:

};

}

#endif //INSCUBEDECODER__RSTHANDLE_H_
